package cn;
import cn.User.AdminUser;
import cn.User.NormalUser;
import cn.User.User;
import cn.book.BookList;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-24
 * Time:14:30
 */
public class Main {
    public static User login()
    {
        Scanner sc=new Scanner(System.in);
        System.out.println("输入你的名字：");
        String name=sc.next();
        if(name.equals("汤琦"))
        {
         return new AdminUser("汤琦");
        }
        else return new NormalUser(name);
    }

    public static void main(String[] args) {
        BookList book=new BookList();
        User user=login();
        while(true)
        {
            int choice=user.menu();
            user.doOperation(choice,book);
        }
    }
}
